import {loadShader} from "@/views/cg/lib/boot/loadShader.ts";

// 01
// import {vertexShaderSource} from "@/views/cg/01-2d/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/01-2d/fragmentShaderSource.ts";

// 02
// import {vertexShaderSource} from "@/views/cg/02-3d-rotate/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/02-3d-rotate/fragmentShaderSource.ts";

// 03
// import {vertexShaderSource} from "@/views/cg/03-2D-transition/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/03-2D-transition/fragmentShaderSource.ts";

// 04
// import {vertexShaderSource} from "@/views/cg/04-3d-perspective/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/04-3d-perspective/fragmentShaderSource.ts";

// 05
// import {vertexShaderSource} from "@/views/cg/05-3d-rotate/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/05-3d-rotate/fragmentShaderSource.ts";

// 06
// import {vertexShaderSource} from "@/views/cg/06-3d-rotate-model/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/06-3d-rotate-model/fragmentShaderSource.ts";

// 07
// import {vertexShaderSource} from "@/views/cg/07-look/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/07-look/fragmentShaderSource.ts";

// 09
// import {vertexShaderSource} from "@/views/cg/09-texture/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/09-texture/fragmentShaderSource.ts";

// 11
// import {vertexShaderSource} from "@/views/cg/11-sphere-color/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/11-sphere-color/fragmentShaderSource.ts";
// import {vertexShaderSource} from "@/views/cg/11-sphere-texture/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/11-sphere-texture/fragmentShaderSource.ts";

// 12
// import {vertexShaderSource} from "@/views/cg/12-model/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/12-model/fragmentShaderSource.ts";

// 13
// import {vertexShaderSource} from "@/views/cg/13-light/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/13-light/fragmentShaderSource.ts";

// 14
// import {vertexShaderSource} from "@/views/cg/14-pointLight/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/14-pointLight/fragmentShaderSource.ts";

// 15
import {vertexShaderSource} from "@/views/cg/15-shouDianPointLight/vertexShaderSource.ts";
import {fragmentShaderSource} from "@/views/cg/15-shouDianPointLight/fragmentShaderSource.ts";

// 16
// import {vertexShaderSource} from "@/views/cg/16-shouDianPointLight2/vertexShaderSource.ts";
// import {fragmentShaderSource} from "@/views/cg/16-shouDianPointLight2/fragmentShaderSource.ts";


export function initProgram(gl){
  // const vertexShaderSource = document.getElementById('vertex-shader').text;
  // const fragShaderSource = document.getElementById('fragment-shader').text;

  const vertexShader = loadShader(gl, gl.VERTEX_SHADER, vertexShaderSource)
  const fragShader = loadShader(gl, gl.FRAGMENT_SHADER, fragmentShaderSource)
  const program = gl.createProgram()

  gl.attachShader(program, vertexShader)
  gl.attachShader(program, fragShader)
  gl.linkProgram(program)

  return program
}
